

package org.ing.sisval.bl;

import java.util.ArrayList;
import org.ing.sisval.be.BEComplementario;
import org.ing.sisval.da.DAComplementario;
import org.ing.sisval.ds.DSUtil;
import org.rx.cr.bl.BLAbstract;
import org.rx.cr.conf.Config;


public class BLComplementario extends BLAbstract<BEComplementario> {

    private DAComplementario dao;


    public BLComplementario(Config conf){
    setDSConeccion(DSUtil._DSConneccion(conf));
    }
//    public BLComplementario(){
//        setDSConeccion(DSUtil._DSConneccion());        
//    }

    @Override
    public int actualizarRegistro(BEComplementario tipo) throws Exception {
      dao = new DAComplementario(getConeccion());
        return dao.actualizarRegistro(tipo);
    }

    @Override
    public int eliminarRegistro(BEComplementario tipo) throws Exception {
   dao = new DAComplementario(getConeccion());
        return dao.eliminarRegistro(tipo); }

    @Override
    public ArrayList<BEComplementario> buscarReferencia(String string) throws Exception {
        dao = new DAComplementario(getConeccion());
        return dao.buscarReferencia(string);
    }

    @Override
    public ArrayList<BEComplementario> listar() throws Exception {
      dao = new DAComplementario(getConeccion());
        return dao.listar();
     }
 
    @Override
    public BEComplementario buscar(int i) throws Exception {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public int registrar(BEComplementario tipo) throws Exception {
        dao =new DAComplementario(getConeccion());
        return dao.registrar(tipo);
          }
    
}
